Fix stale hover reuse for unchanged regions#1533
Conversation
|
What are the new conditions to avoid reusing a previoulsy computed hover request? Is it now always recomputed? Could you specify if as part of the commit / PR message? |
LSPTextHover reused a completed hover request when the viewer and hover region were unchanged. As a result, a repeated hover over the same region could return stale content and avoid issuing a fresh textDocument/hover request. A previous request is still reused while it is in progress for the same viewer/region, but any completed requests are now treated as stale, so a subsequent hover on the same region starts a fresh textDocument/hover request instead of reusing the old completed result indefinitely. Fixes eclipse-lsp4e#1514
Hi, good question. No it is not always recomputed. I've updated the commit message appropriately. Cheers John |
|
Hi @rubenporras , I see the following failure for my PR: continuous-integration/jenkins/pr-merge — This commit cannot be built I'm not sure what I need to do, if anything. Is it simply waiting for a committer to approve the run? |
Hi @rubenporras , |
|
I haven't reviewed the code (yet), but I approved the workflow runs |
I think this will trigger many unneeded recomputations. Could we do it so that we invalidate the last computed hover request only if the editor looses focus? That should cover the case of external resources and be less agressive on the computation side. |
Hi @rubenporras , I like the goal of optimising the number of recomputations, and your idea of triggering this on editor focus lost, but I'm skeptical whether its worth it or always beneficial. For instance, consider the case where the editor focus is not lost, but an external event causes the need for a recomputation. That could happen if the user starts a project build using a keybaord shortcut (ctrl+B) and this causes header files to be built which generate new values in the external resources. Also I did some tests in vscode and see that it always generates a hover request without trying to optimise the request - see below. Would you be willing to reconsider this please? == testA hover 1 testA hover 2 *: vscode using extension "llvm-vs-code-extensions.vscode-clangd" and settings.json set with: |
LSPTextHover reused a completed hover request when the viewer and hover region were unchanged. As a result, a repeated hover over the same region could return stale content and avoid issuing a fresh textDocument/hover request.
Fixes #1514